home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2005 October / PCWOCT05.iso / Software / FromTheMag / Syn Text Editor 2.1.0.46 / synsetup-2.1.0.46.exe / {app} / scripts / txt2pdf.vbs < prev    next >
Text File  |  2003-09-13  |  774b  |  28 lines

  1. ' Caption: Converts Text to PDF|
  2. ' Hint: Converts active document to PDF|
  3. ' Icon: <The Icon from the Menuitem>|
  4.  
  5. option explicit
  6.  
  7. ' Remove the dot to include this files
  8. '#.include <consts>
  9. '#include <cmnfunc>
  10.  
  11. const mpdf = "C:\win\lcc\projects\my\mpdf\lcc\mpdf.exe"
  12.  
  13. sub Main(dummy)
  14.   if Documents.Count = 0 then
  15.     exit sub
  16.   end if
  17.   dim txt, pdf, cmd
  18.   txt = ActiveDocument.FileName
  19.   pdf = ChangeFileExt(txt, ".pdf")
  20.   if FileExists(txt) then
  21.     cmd = AddQuotesUnless(mpdf) & " -t -m fscrn -p letter -l single " & _
  22.     AddQuotesUnless(txt) & " " & AddQuotesUnless(pdf)
  23. '    Exec mpdf, "-t -m fscrn -p letter -l single " & _
  24. '    AddQuotes(txt) & " " & AddQuotes(pdf), ActiveDocument.FilePath, true
  25.     Execute cmd, 1, true
  26.   end if
  27. end sub
  28.